﻿<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
                assembly="KuaJing.Customs"
				        namespace="KuaJing.Customs.Domain">

  <class name="Declaration" table="Customs_Declaration">
    <id name="Id" access="field.camelcase" type="Int32" column="DeclarationId">
      <generator class="native" />
    </id>
    <version name="Version" access="field.camelcase" />


    <property name="Code" unique="true" />
    <property name="PreInputNumber" />
    <property name="ExportPort" />
    <property name="ExportPortNumber" />
    <property name="RegistrationNumber" />
    <property name="ExportDate" />
    <property name="DeclarationDate" />
    <property name="BusinessUnit" />
    <property name="BusinessUnitNumber" />
    <property name="TransportModel" />
    <property name="TransportName" />
    <property name="DeliveryNumber" />
    <property name="ForwardingUnit" />
    <property name="ForwardingUnitNumber" />
    <property name="TradeModel" />
    <property name="TradeModelNumber" />
    <property name="NatureOfExemption" />
    <property name="NatureOfExemptionNumber" />
    <property name="SettlementWay" />
    <property name="LicenseNumber" />
    <property name="TradeCountry" />
    <property name="TradeCountryNumber" />
    <property name="DestinationlCountry" />
    <property name="DestinationCountryNumber" />
    <property name="DestinationPort" />
    <property name="DestinationPortNumber" />
    <property name="DomesticLocation" />
    <property name="DomesticLocationNumber" />
    <property name="ApprovalNumber" />
    <property name="TransactionModel" />
    <property name="TransportFee" />
    <property name="InsuranceFee" />
    <property name="IncidentalFee" />
    <property name="ContractNumber" />
    <property name="GoodsNumber" />
    <property name="PackageType" />
    <property name="GrossWeight" />
    <property name="NetWeight" />
    <property name="ContainerNumber" />
    <property name="DocumentsAttached" />
    <property name="Manufacturer" />
    <property name="MarkAndRemark" />
    <property name="ApplicationUnit" />
    <property name="ApplicationUnitNumber" />

    <set name="Items" cascade="all">
      <key column="DeclarationId" foreign-key="FK_Declaration_DeclarationItem" />
      <one-to-many class="DeclarationItem" />
    </set>
    <many-to-one name="File" column="FileId" class="KuaJing.Common.Domain.File,KuaJing.Common" cascade="all" foreign-key="FK_Declaration_File" />



    <property name="CreatedTime" access="field.camelcase" />
    <property name="CreatedUserName" access="field.camelcase" />
    <property name="ModifiedTime" access="field.camelcase" />
    <property name="ModifiedUserName" access="field.camelcase" />
    <property name="AccessedTime" access="field.camelcase" />
    <property name="AccessedUserName" access="field.camelcase" />
    <property name="Memo" />
    <property name="IsInvalid" />
  </class>
</hibernate-mapping>
